<template>
  <view class="detailMain">
    <view class="detailBox">
      <u-cell-group>
        <u-cell-item title="名称" value="培训班名称" :arrow="false"></u-cell-item>
        <u-cell-item title="时间" value="2025年3月至2025年4月" :arrow="false"></u-cell-item>
        <u-cell-item title="地点" value="内蒙古呼和浩特市新城区" :arrow="false"></u-cell-item>
        <u-cell-item title="培训内容" :arrow="false"></u-cell-item>
      </u-cell-group>
      <view class="content">
        <text>1、安全工器具检查与使用：确保正确使用工器具，保障作业安全。</text>
        <text>2、高处坠落风险辨识与防护：识别高空作业风险，采取防护措施。</text>
      </view>
      <u-cell-group>
        <u-cell-item title="班主任" value="张老师" :arrow="false"></u-cell-item>
        <u-cell-item title="培训老师" value="李老师" :arrow="false"></u-cell-item>
      </u-cell-group>
      <view class="navView"></view>
      <u-cell-group>
        <u-cell-item title="单位" :value="type !== 'ybm' ? '请选择' : 'abc有限公司'" :arrow="type !== 'ybm'"></u-cell-item>
        <u-cell-item @click="zsShow = true;" title="住宿" :value="type !== 'ybm' ? '请选择' : '标准双人间(含早餐，独立卫浴)'" :arrow="type !== 'ybm'"></u-cell-item>
        <u-cell-item @click="cybzShow = true;" title="餐饮标准" :value="type !== 'ybm' ? '请选择' : '标准工作餐(一荤两素+水果(¥50/天))'" :arrow="type !== 'ybm'"></u-cell-item>
      </u-cell-group>
      <!--立即报名-->
      <view class="btnBox">
        <u-button type="primary" @click="SignUp" v-if="type !== 'ybm'">立即报名</u-button>
        <u-button type="warning" @click="SignUp" v-else>取消报名</u-button>
      </view>
    </view>
    <!--住宿-->
    <u-select v-model="zsShow" :list="zslist"></u-select>
    <!--餐饮标准-->
    <u-select v-model="cybzShow" :list="cybzlist"></u-select>
    <u-back-top :scroll-top="scrollTop"></u-back-top>
    <u-top-tips ref="uTips"></u-top-tips>
    <toast></toast>
  </view>
</template>
<script>
export default {
  data() {
    return {
      scrollTop: 0,
      type: '',
      zsShow: false,
      cybzShow: false,
      zslist: [{
        label: '标准双人间(含早餐，独立卫浴)',
        value: 1
      }, {
        label: '商务单人间(含早餐，商务办公区)',
        value: 2
      }],
      cybzlist: [{
        label: '标准工作餐(一荤两素+水果(¥50/天))',
        value: 1
      }, {
        label: '素食套餐(全素营养搭配(¥60/天))',
        value: 2
      }, {
        label: 'VIP定制餐(主厨定制菜(¥100/天))',
        value: 3
      }]
    }
  },
  onLoad(option) {
    this.type = option.type;
  },
  onShow() {},
  onPullDownRefresh() {},
  onShareAppMessage() {},
  methods: {
    /* 顶部提示文字 */
    uTips(title, type = 'warning', duration = 1500) {
      this.$refs.uTips.show({
        title: title,
        type: type,
        duration: duration,
      })
    },
    /* 返回顶部 */
    onPageScroll(e) {
      this.scrollTop = e.scrollTop
    },
    // 立即报名
    SignUp(){
      uni.switchTab({
        url: 'pages/mine/index'
      });
    }
  },
}
</script>
<style lang="scss" scoped>
page {
  background: #fff;
  padding-bottom: 120rpx;
}
.detailMain{
  padding: 0 20rpx;
}
.content{
  padding: 20rpx;
  >text{
    display: block;
    font-size: 28rpx;
    line-height: 44rpx;
  }
}
.navView{
  height: 20rpx;
  background: #f1f1f1;
}
.btnBox{
  padding: 20rpx 0;
}
</style>
